package com.resource.converter;

import com.resource.dto.CustomerLinkmanSaveDto;
import com.resource.request.CustomerLinkmanSaveRequest;
import org.mapstruct.InheritInverseConfiguration;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

import com.resource.dto.CustomerSaveDto;
import com.resource.dto.OfficeProjectInfoDto;
import com.resource.request.CustomerSaveRequest;

/**
 * 
 * 泛微系统请求对象转换
 * 
 * @Author: xiongbo.wan
 * @Date: 8:27 2020/9/24 0024
 */
@Mapper(componentModel = "spring")
public interface CustomerLinkmanConverter {

	@Mappings({
            @Mapping(source = "linkman_id", target = "linkmanId"),
            @Mapping(source = "linkman_name", target = "linkmanName"),
			@Mapping(source = "_text_sex", target = "textSex"),
			@Mapping(source = "customer_id", target = "customerId"),
			@Mapping(source = "_text_customer_id", target = "textCustomerId"),
			@Mapping(source = "main_linkman", target = "mainLinkman"),
			@Mapping(source = "_text_main_linkman", target = "textMainLinkman"),
			@Mapping(source = "mobile_phone_number", target = "mobilePhoneNumber"),
			@Mapping(source = "company_phone_number", target = "companyPhoneNumber"),
			@Mapping(source = "fax_number", target = "faxNumber"),
			@Mapping(source = "home_phone_number", target = "homePhoneNumber"),
			@Mapping(source = "qq_number", target = "qqNumber"),
			@Mapping(source = "zip_code", target = "zipCode"),
			@Mapping(source = "linkman_picture", target = "linkmanPicture"),
			@Mapping(source = "linkman_remarks", target = "linkmanRemarks"),
			@Mapping(source = "linkman_creator", target = "linkmanCreator"),
			@Mapping(source = "_text_linkman_creator", target = "textLinkmanCreator"),
			@Mapping(source = "is_all", target = "isAll"),
			@Mapping(source = "_text_is_all", target = "textIsAll"),
			@Mapping(source = "dept_ids", target = "deptIds"),
			@Mapping(source = "_text_dept_ids", target = "textDeptIds"),
			@Mapping(source = "role_ids", target = "roleIds"),
			@Mapping(source = "_text_role_ids", target = "textRoleIds"),
			@Mapping(source = "user_ids", target = "userIds"),
			@Mapping(source = "_text_user_ids", target = "textUserIds"),
			@Mapping(source = "business_sector", target = "businessSector"),
			@Mapping(source = "_text_business_sector", target = "textBusinessSector"),
			@Mapping(source = "field_3", target = "field3"),

            })
	/**
	 * request转换成dto
	 * @param request
	 * @return
	 */
	CustomerLinkmanSaveDto requestToDto(CustomerLinkmanSaveRequest request);
	/**
	 * dto转换成request
	 * @param dto
	 * @return
	 */
	@InheritInverseConfiguration
	CustomerLinkmanSaveRequest dtoToRequest(CustomerLinkmanSaveDto dto);


}
